package com.kgar.controller;

import com.kgar.dto.Result;
import com.kgar.entity.pojo.JobInfo;
import com.kgar.entity.pojo.Recruiter;
import com.kgar.service.RecruiterService;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * @author Trimb
 */
@RestController
@RequestMapping("recruitment")
public class RecruitmentController {

    @Resource
    private RecruiterService recruiterService;


    @PostMapping("saveBaseInfo")
    public Result saveBaseInfo(@RequestBody Recruiter recruiter){
        return recruiterService.saveBaseInfo(recruiter);
    }
    @PostMapping("getBaseInfo")
    public Result getBaseInfo(){
        return recruiterService.getBaseInfo();
    }

    @PostMapping("addJob")
    public Result saveJob(@RequestBody JobInfo jobInfo){
        return recruiterService.saveJob(jobInfo);
    }

    @PostMapping("getJobs")
    public Result getJobs(){
        return recruiterService.getJobs();
    }
    @PostMapping("bestResume/{jobId}")
    public Result getBestResume(@PathVariable("jobId") Integer jobId){
        return recruiterService.getBestResume(jobId);
    }
    @PostMapping("graph")
    public Result getGraph(){
        return recruiterService.getGraph();
    }
    @DeleteMapping("delete/{jobId}")
    public Result removeJobById(@PathVariable("jobId") Integer jobId){
        return recruiterService.removeJobById(jobId);
    }
    @PutMapping("updateJob")
    public Result updateJob(@RequestBody JobInfo jobInfo){
        return recruiterService.updateJob(jobInfo);
    }
}
